package com.sgb.kjwl.view.ui.activity.transport;

import android.content.Context;
import android.content.Intent;
import android.view.View;

import androidx.lifecycle.ViewModelProvider;

import com.sgb.kjwl.R;
import com.sgb.kjwl.databinding.ActivityProfessionalSalesBinding;
import com.sgb.kjwl.view.constant.RouterKey;
import com.sgb.kjwl.viewmodel.transport.ProfessionalSalesModel;
import com.swgk.core.common.base.BaseActivity;

/**
 * 专业销售
 */
public class ProfessionalSalesActivity extends BaseActivity<ProfessionalSalesModel, ActivityProfessionalSalesBinding> {

    public static void start(Context context, int no) {
        Intent intent = new Intent(context, ProfessionalSalesActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        intent.putExtra(RouterKey.NO, no);
        context.startActivity(intent);
    }

    @Override
    protected int layoutId() {
        return R.layout.activity_professional_sales;
    }

    @Override
    protected void createViewModel() {
        mViewModel = new ViewModelProvider(this).get(ProfessionalSalesModel.class);
    }

    @Override
    protected void init() {
        int type = getIntent().getIntExtra(RouterKey.NO, 0);
        switch (type) {
            case 1:
                mBinding.include.titleView.setText("专业销售");
                break;
            case 2:
                mBinding.include.titleView.setText("会员经营");
                break;

        }
        initEvent();
    }

    private void initEvent(){
        mBinding.include.ivBack.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (v == mBinding.include.ivBack) {
            finish();
        }
    }
}
